package com.cci.kangdao.dao;

import java.util.Map;


import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mybatis.spring.annotation.MapperScan;

/**
 * 用户App评价dao
 *
 */
@MapperScan
public interface WorkOrderCommTDao {
	
	/**
	 * 保存用户app评价信息
	 * @param type
	 * @return
	 */
	public int insertWorkOrderCommT(Map<String, Object> map);

	//根据工单id获取用户app评价信息
	@Select("select OrderId as orderId,BackNormal as backNormal,Satisfaction as satisfaction,UnSatisfiedReason as unSatisfiedReason,UnSatisfiedExplain as unSatisfiedExplain,\n" +
			"IsCharged as isCharged,WillShare as willShare,ShareReason as shareReason,ShareExplain as shareExplain,RepairReasonDescription as repairReasonDescription,CumminsProductServiceSumRecommendValue as cumminsProductServiceSumRecommendValue,\n" +
            "CumminsProductServiceSumRecommendValueSuggest as cumminsProductServiceSumRecommendValueSuggest,CumminsProductSatisfactionValue as cumminsProductSatisfactionValue,CumminsProductSatisfactionValueSuggest as cumminsProductSatisfactionValueSuggest,\n" +
			"CumminsServiceSatisfactionValue as cumminsServiceSatisfactionValue,CumminsServiceSatisfactionValueSuggest as cumminsServiceSatisfactionValueSuggest,\n" +
			"ServiceIsFinish as serviceIsFinish,WillShareServiceStationGrades as willShareServiceStationGrades,NotRecommendServiceStationReason as notRecommendServiceStationReason,\n" +
			"NotRecommendServiceStationExplain as notRecommendServiceStationExplain,ServiceIsFinish as serviceIsFinish,MemberServiceSatisfactionValue as memberServiceSatisfactionValue,MemberServiceSatisfactionValueSuggest as memberServiceSatisfactionValueSuggest\n" +
			"from WorkOrderComm_T where OrderId = #{orderId} and Flag =0")
	Map<String,Object> getUserAppraiseMsgByOrderId(@Param("orderId") long orderId);

	//根据工单id获取xcec售时工单用户app评价信息
	@Select("select top 1 OrderId as orderId,Satisfaction as satisfaction,UnSatisfiedReason as unSatisfiedReason,UnSatisfiedExplain as unSatisfiedExplain,\n" +
			"IsCheckEngine as isCheckEngine,IsTraining as isTraining\n" +
			"from WorkOrderComm_T where OrderId = #{orderId}  and Flag =0 order by ID desc")
	Map<String,Object> getXCECSSUserAppraiseMsgByOrderId(@Param("orderId") long orderId);
}
